package com.itheima.system.controller;

import com.itheima.common.entity.Result;
import com.itheima.common.entity.ResultCode;
import com.itheima.system.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author qiankaofei
 * @version 1.0
 * @date 2020/12/7 21:38
 */
@CrossOrigin
@RestController
@RequestMapping("/sys/city")
public class CityController {

    /**
     * 查询所有城市
     */
    @Autowired
    private CityService cityService;

    /**
     * 查询所有城市
     */
    @GetMapping
    public Result findAllCity(){
        return new Result(ResultCode.SUCCESS,cityService.findAllCity());
    }
}
